import upload from '@/utils/upload'
import request from '@/utils/request'

export function list(data) {
  return request({
    url: '/seller/cashier/list',
    method: 'get',
    data: data
  })
}

export function add(data,code) {
	return request({
	  url: `/seller/cashier/${code}`,
	  method: 'post',
	  data: data
	})
}

export function edit(data,code) {
	return request({
	  url: `/seller/cashier/${code}`,
	  method: 'put',
	  data: data
	})
}

export function remove(id) {
	return request({
	  url: '/seller/cashier/remove/'+id,
	  method: 'post'
	})
}

export function info(id) {
	return request({
	  url: '/seller/cashier/info/'+id,
	  method: 'get'
	})
}

export function changeStatus(data) {
	return request({
	  url: '/seller/cashier/changeStatus',
	  method: 'post',
	  data: data
	})
}

// 文件上传
export function uploadFile(data) {
  return upload({
    url: '/seller/cashier/import',
    name: data.name,
    filePath: data.filePath
  })
}